package main

import (
	"fmt"
	"time"
)

func main() {

	ch := make(chan int)
	go func() {

		if v, notClosed := <-ch; notClosed {
			fmt.Println(v)
		} else {
			fmt.Println("channel is closed")
		}
	}()
	close(ch)

	time.Sleep(5 * time.Second)
}
